/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.tesoreria.be;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.cip.esymons.colegiatura.be.Colegiado;
import org.cip.esymons.general.be.PersonaJuridica;

/**
 *
 * @author Gilmar
 */
@Entity
@Table(name = "tes_delegado_acotacion")
@NamedQueries({@NamedQuery(name = "DelegadoAcotacion.findAll", query = "SELECT d FROM DelegadoAcotacion d"), @NamedQuery(name = "DelegadoAcotacion.findByDacCodigo", query = "SELECT d FROM DelegadoAcotacion d WHERE d.dacCodigo = :dacCodigo"), @NamedQuery(name = "DelegadoAcotacion.findByDacEspecialidad", query = "SELECT d FROM DelegadoAcotacion d WHERE d.dacEspecialidad = :dacEspecialidad"), @NamedQuery(name = "DelegadoAcotacion.findByDacCargo", query = "SELECT d FROM DelegadoAcotacion d WHERE d.dacCargo = :dacCargo"), @NamedQuery(name = "DelegadoAcotacion.findByDacMes", query = "SELECT d FROM DelegadoAcotacion d WHERE d.dacMes = :dacMes"), @NamedQuery(name = "DelegadoAcotacion.findByDacAnio", query = "SELECT d FROM DelegadoAcotacion d WHERE d.dacAnio = :dacAnio"), @NamedQuery(name = "DelegadoAcotacion.findByDacfechaRegistro", query = "SELECT d FROM DelegadoAcotacion d WHERE d.dacfechaRegistro = :dacfechaRegistro"), @NamedQuery(name = "DelegadoAcotacion.findByDacEstado", query = "SELECT d FROM DelegadoAcotacion d WHERE d.dacEstado = :dacEstado")})
public class DelegadoAcotacion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "dac_codigo", nullable = false)
    private Long dacCodigo;
    @Column(name = "dac_especialidad", length = 100)
    private String dacEspecialidad;
    @Column(name = "dac_cargo", length = 100)
    private String dacCargo;
    @Column(name = "dac_mes")
    private Integer dacMes;
    @Column(name = "dac_anio")
    private Integer dacAnio;
    @Column(name = "dac_fechaRegistro")
    @Temporal(TemporalType.DATE)
    private Date dacfechaRegistro;
    @Column(name = "dac_estado")
    private Integer dacEstado;
    @OneToMany(mappedBy = "dacCodigo", fetch = FetchType.LAZY)
    private List<PagosAcotacion> pagosAcotacionList;
    @JoinColumn(name = "col_codigo", referencedColumnName = "col_codigo")
    @ManyToOne(fetch = FetchType.LAZY)
    private Colegiado colCodigo;
    @JoinColumn(name = "emp_codigo", referencedColumnName = "emp_codigo")
    @ManyToOne(fetch = FetchType.LAZY)
    private PersonaJuridica empCodigo;

    public DelegadoAcotacion() {
    }

    public DelegadoAcotacion(Long dacCodigo) {
        this.dacCodigo = dacCodigo;
    }

    public Long getDacCodigo() {
        return dacCodigo;
    }

    public void setDacCodigo(Long dacCodigo) {
        this.dacCodigo = dacCodigo;
    }

    public String getDacEspecialidad() {
        return dacEspecialidad;
    }

    public void setDacEspecialidad(String dacEspecialidad) {
        this.dacEspecialidad = dacEspecialidad;
    }

    public String getDacCargo() {
        return dacCargo;
    }

    public void setDacCargo(String dacCargo) {
        this.dacCargo = dacCargo;
    }

    public Integer getDacMes() {
        return dacMes;
    }

    public void setDacMes(Integer dacMes) {
        this.dacMes = dacMes;
    }

    public Integer getDacAnio() {
        return dacAnio;
    }

    public void setDacAnio(Integer dacAnio) {
        this.dacAnio = dacAnio;
    }

    public Date getDacfechaRegistro() {
        return dacfechaRegistro;
    }

    public void setDacfechaRegistro(Date dacfechaRegistro) {
        this.dacfechaRegistro = dacfechaRegistro;
    }

    public Integer getDacEstado() {
        return dacEstado;
    }

    public void setDacEstado(Integer dacEstado) {
        this.dacEstado = dacEstado;
    }

    public List<PagosAcotacion> getPagosAcotacionList() {
        return pagosAcotacionList;
    }

    public void setPagosAcotacionList(List<PagosAcotacion> pagosAcotacionList) {
        this.pagosAcotacionList = pagosAcotacionList;
    }

    public Colegiado getColCodigo() {
        return colCodigo;
    }

    public void setColCodigo(Colegiado colCodigo) {
        this.colCodigo = colCodigo;
    }

    public PersonaJuridica getEmpCodigo() {
        return empCodigo;
    }

    public void setEmpCodigo(PersonaJuridica empCodigo) {
        this.empCodigo = empCodigo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (dacCodigo != null ? dacCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DelegadoAcotacion)) {
            return false;
        }
        DelegadoAcotacion other = (DelegadoAcotacion) object;
        if ((this.dacCodigo == null && other.dacCodigo != null) || (this.dacCodigo != null && !this.dacCodigo.equals(other.dacCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cip.esymons.tesoreria.be.DelegadoAcotacion[dacCodigo=" + dacCodigo + "]";
    }

}
